<template>
  <div>
    我是 vitesub2 微应用页面
  </div>
  <button @click="goApplication('/')">去主应用页面</button>
  <br>
  <button style="margin-top: 10px;" @click="goApplication('/vitesub1')">去vitesub1 微应用页面</button>
  <div style="margin-top: 10px;">
    <button @click="setToken_">设置Token</button>
    <button style="margin-left: 10px;" @click="getToken_">获取Token</button>
  </div>
  <button @click="setState">改变状态</button>
</template>

<script setup>
import useApplication from '../hooks/useApplication'
import { setToken, getToken } from '../utils/auth'
const { goApplication, global } = useApplication()

const setToken_ = () => {
  setToken()
}

const getToken_ = () => {
  const token = getToken()
  console.log(token);
}

const setState = () => {
  global.setGlobalState({ time: 300 })
}
</script>

<style  scoped></style>